﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XYZshell.Game.CardGameEngine
{
	/// <summary>
	/// 游戏实体对象,所有游戏实体类的基类
	/// </summary>
	[Serializable]
	public  class GameObject
	{
		/// <summary>
		/// 根据属性名获得对应属性的值
		/// </summary>
		/// <param name="name">属性名</param>
		/// <returns>对应属性的值</returns>
		public virtual object   GetValue(string name)
		{
			return  this.GetType().GetProperty( name ).GetValue( this, null );
		}
		/// <summary>
		/// 设置指定属性名的属性值
		/// </summary>
		/// <param name="name">属性名</param>
		/// <param name="value">属性的值</param>
		public virtual void  SetValue(string name,object value)
		{
			this.GetType().GetProperty( name ).SetValue( this, value, null );
		}
		public Game Game
		{
			get;
			set;
		}
	}
}
